echo U SURE

set -u
set -e

KEY=`grep wmata.api.key res/raw/app.properties | cut -d= -f 2`

TMP=/tmp/bus_routes.xml
wget -O $TMP http://api.wmata.com/Bus.svc/Routes?api_key=${KEY}
#cp $TMP res/xml/bus_routes.xml

#TMP=/tmp/tmp.xml
#cat ${TMP} \
  #| sed -e "s/xmlns:a=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/Arrays\"//g;s/a:string/s/g" \
  #| sed -e "s/<Stop/<St/g;s/<\/Stop/<\/St/g;s/<Route/<Rt/g;s/<\/Route/<\/Rt/g;s/<Name/<Nm/g;s/<\/Name/<\/Nm/g;" \
  #> res/xml/bus_stops2.xml
  #> /tmp/tmp2.xml
#ls -l res/xml/bus_stops.xml

